package com.atguigu.gmall.activity.client;

import com.atguigu.gmall.activity.client.impl.ActivityDegradeFeignClient;
import com.atguigu.gmall.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.Map;

@FeignClient(value = "service-activity", path = "/api/activity", fallback = ActivityDegradeFeignClient.class)
public interface ActivityFeignClient {


    /**
     * 查询当日参与秒杀商品
     *
     * @return
     */
    @GetMapping("/seckill/findAll")
    public Result getSeckillGoods();

    /**
     * 查询秒杀商品详情
     * @param skuId
     * @return
     */
    @GetMapping("/seckill/getSeckillGoods/{skuId}")
    public Result getSecGoodsById(@PathVariable("skuId") Long skuId);



    /**
     * 汇总秒杀订单确认页面数据汇总
     * @param userId 用户ID
     * @param skuId 秒杀商品ID
     * @return
     */
    @GetMapping("/seckill/auth/trade/{skuId}")
    public Result<Map> getSeckillOrderTradeData(@RequestHeader("userId") String userId, @PathVariable("skuId") Long skuId);

}
